class Solution
{
public:
    int longestContinuousSubstring(string s)
    {
        int maxContinuousLen = 1;
        int currentContinuousLen = 1;
        int n = s.size();
        char last = s[0];
        for (int i = 1; i < n; ++i)
        {
            if (s[i] == s[i - 1] + 1)
            {
                ++currentContinuousLen;
                maxContinuousLen = max(currentContinuousLen, maxContinuousLen);
            }
            else
            {
                currentContinuousLen = 1;
            }
        }
        return maxContinuousLen;
    }
};